var server="http://121.41.88.185:8080";
var cab="&callback=?";

//login sever config
var loginServer={
  fun:"/parkUser.action?login",
  telephone:"&telephone=",
  password:"&password=",
  getLoginReq:function(tel,pas){
    return server+this.fun+this.telephone+tel+this.password+pas+cab;
  }
}

//logout sever config
var logoutServer={
  fun:"/parkUser.action?logout&callback=?",
  telephone:"&telephone=",
  getLogoutReq:function(tel){
    return server+this.fun+this.telephone+tel+cab;
  }
}


function hideMainAFooter(){
  $("#mainfooter").hide();
  $("#mainheader").hide();
}

function showMainAFooter(){
  $("#mainfooter").show();
  $("#mainheader").show();
}


function resetAll(){
  $("input").each(function(){
    $(this).val("");
  });
  $("#hours").html("00");
  $("#mints").html("00");
  $("#cost").html(" ￥0.00");
}

function isNumber(event, element) {
  if (event) {
    var max_chars = element.getAttribute("max").length;
    var charCode = (event.which) ? event.which : event.keyCode;
    if (charCode != 190 && charCode > 31 &&
      (charCode < 48 || charCode > 57) &&
      (charCode < 96 || charCode > 105) &&
      (charCode < 37 || charCode > 40) &&
      charCode != 110 && charCode != 8 && charCode != 46 ) {
        return false;
    }
    if (element.value.length >= max_chars && charCode > 47) {
      return false;
    }else {
      return true;
    }
  }
}
